import { EntityModel } from '@midwayjs/orm';
import { BaseEntity } from '@cool-midway/core';
import { Column, Index } from 'typeorm';

/**
 * 商品
 */
@EntityModel('demo_goods')
export class DemoGoodsEntity extends BaseEntity {
	@Index()
	@Column({ comment: '公司ID', type: 'bigint' })
	departmentId: number;

	@Column({ comment: '姓名' })
	name: string;

	@Column({ comment: '性别' })
	gender: string;

	@Column({ comment: '证件类型' })
	idType: string;

	//@Index({ unique: true })
	@Column({ comment: '身份证号', unique: true })
	idnumber: string;

	@Column({ comment: '出生日期', type: 'timestamp', nullable: true })
	birthday: Date;

	@Column({ comment: '年龄', nullable: true })
	age: string;

	@Column({ comment: '工种' })
	type: string;

	@Column({ comment: '方案' })
	plan: string;

	@Column({ comment: '增员日期', type: 'timestamp', nullable: true })
	plusDate: Date;

	@Column({ comment: '减员日期', type: 'timestamp', nullable: true })
	minusDate: Date;

	@Column({ comment: '保费', type: 'decimal', precision: 5, scale: 2, nullable: true })
	premium: number;

	@Column({ comment: '状态', type: 'bigint', nullable: true })
	state: number;

	@Column({ comment: '是否新增', type: 'bigint', nullable: true })
	isNew: number;
}
